package com.pmcc.core.web;

import com.pmcc.core.entity.Tags;
import com.pmcc.core.service.TagsService;
import com.pmcc.utils.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by spurs on 2018/11/12.
 */
@RestController()
@RequestMapping("api/v1/tags")
@Api(value = "TagsController" , description = "新增个人标签")
public class TagsController {
    @Autowired
    TagsService tagsService;

//    @ApiOperation(value="新增", httpMethod="GET",notes="新增个人标签", response = ResultBean.class)
//    @GetMapping("add")
//    public ResultBean add(@ApiParam(required =true, name ="客户ID", value ="id")String id,String tag) {
//        return tagsService.add(id,tag);
//    }

    @ApiOperation(value = "新增", httpMethod="POST",notes = "新增个人标签", response = ResultBean.class)
    @PostMapping("")
    public ResultBean add(@ApiParam(required =true, name ="客户对象", value ="除ID以外的实体参数")@RequestBody Tags model) throws Exception{
        return tagsService.add(model);
    }
}
